﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WaferSelectV3.DAL.Migrations
{
    /// <inheritdoc />
    public partial class InitialCreateOrder : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BoxStates",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BoxNumber = table.Column<int>(type: "int", nullable: false),
                    CountMax = table.Column<int>(type: "int", nullable: false),
                    UpCount = table.Column<int>(type: "int", nullable: false),
                    DownCount = table.Column<int>(type: "int", nullable: false),
                    BoxLockedSeconds = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BoxStates", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "CrystalLevelCounts",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CrystalNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LevelIndex = table.Column<int>(type: "int", nullable: false),
                    LevelType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Count = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CrystalLevelCounts", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "LevelCountsHistory",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CrystalNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductionDate = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Lv01 = table.Column<int>(type: "int", nullable: false),
                    Lv02 = table.Column<int>(type: "int", nullable: false),
                    Lv03 = table.Column<int>(type: "int", nullable: false),
                    Lv04 = table.Column<int>(type: "int", nullable: false),
                    Lv05 = table.Column<int>(type: "int", nullable: false),
                    Lv06 = table.Column<int>(type: "int", nullable: false),
                    Lv07 = table.Column<int>(type: "int", nullable: false),
                    Lv08 = table.Column<int>(type: "int", nullable: false),
                    Lv09 = table.Column<int>(type: "int", nullable: false),
                    Lv10 = table.Column<int>(type: "int", nullable: false),
                    Lv11 = table.Column<int>(type: "int", nullable: false),
                    Lv12 = table.Column<int>(type: "int", nullable: false),
                    Lv13 = table.Column<int>(type: "int", nullable: false),
                    Lv14 = table.Column<int>(type: "int", nullable: false),
                    Lv15 = table.Column<int>(type: "int", nullable: false),
                    Lv16 = table.Column<int>(type: "int", nullable: false),
                    Lv17 = table.Column<int>(type: "int", nullable: false),
                    Lv18 = table.Column<int>(type: "int", nullable: false),
                    Lv31 = table.Column<int>(type: "int", nullable: false),
                    Lv32 = table.Column<int>(type: "int", nullable: false),
                    Lv33 = table.Column<int>(type: "int", nullable: false),
                    Lv34 = table.Column<int>(type: "int", nullable: false),
                    Lv35 = table.Column<int>(type: "int", nullable: false),
                    Lv36 = table.Column<int>(type: "int", nullable: false),
                    Lv37 = table.Column<int>(type: "int", nullable: false),
                    Lv38 = table.Column<int>(type: "int", nullable: false),
                    Lv39 = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_LevelCountsHistory", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "ModuleShields",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ModuleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsShielded = table.Column<bool>(type: "bit", nullable: false),
                    CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ModuleShields", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SlaveParams",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SlaveName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SlaveIp = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SlavePort = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaveParams", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "UserInfos",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Password = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Role = table.Column<int>(type: "int", nullable: false),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LastLoginTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfos", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "VisionOffsets",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ModuleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OptionName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OffsetK = table.Column<double>(type: "float", nullable: false),
                    OffsetB = table.Column<double>(type: "float", nullable: false),
                    CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_VisionOffsets", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "WaferSummaries",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DetectedTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductionDate = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WaferId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CutNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CrystalNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PositionNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductionLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FlowerNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DetectionRecipe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DetectedLevel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LevelType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TypeDescription = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BoxNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ThicknessAver = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TTV = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LineTraceMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Warping = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ThicknessMin = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ThicknessMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDenseLine = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LineTraceUpNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LineTraceUpMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LineTraceDownNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LineTraceDownMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LineTraceCount = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ResistivityAver = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ResistivityMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ResistivityMin = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LengthMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LengthMin = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LengthX = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LengthY = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DiagonalLeftStart = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DialonalRightStart = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ChamferMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ChamferMin = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpDownParallel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LeftRightParallel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SquareLineMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SquareLineMin = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VerticalAngleMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VerticalAngleMin = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LeftTopCharmfer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RightTopCharmfer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LeftBottomCharmfer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RightBottomCharmfer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LeftTopAngle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RightTopAngle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LeftBottomAngle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RightBottomAngle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LengthXMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LengthXMin = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LengthYMax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LengthYMin = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FrontEdgeBreakExist = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FrontEdgeBreakNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FrontEdgeBreakArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BackEdgeBreakExist = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BackEdgeBreakNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BackEdgeBreakArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LeftEdgeBreakExist = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LeftEdgeBreakNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LeftSurfaceBreakExist = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LeftSurfaceBreakNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RightEdgeBreakExist = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RightEdgeBreakNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RightSurfaceBreakExist = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RightSurfaceBreakNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeUpExist = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SmudgeUpArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeUpNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeUpReverse = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeUpHoleExist = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeUpHoleNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HoleExistUp = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HoleNumUp = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeDownExist = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeDownArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeDownNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeDownReverse = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeDownHoleExist = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SumdgeDownHoleNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HoleExistDown = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HoleNumDown = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureExist01 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureArea01 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureNum01 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureBreakExist01 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureBreakArea01 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureBreakNum01 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureHoleExist01 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureHoleNum01 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureExist02 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureArea02 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureNum02 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureBreakExist02 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureBreakArea02 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureBreakNum02 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureHoleExist02 = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubfissureHoleNum02 = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WaferSummaries", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "WorkingInfos",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FlowerNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductionDate = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CutNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentCrystalNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TheoryCounts = table.Column<int>(type: "int", nullable: false),
                    RealCounts = table.Column<int>(type: "int", nullable: false),
                    PositionNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductionLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductionRecipe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LastCrystalNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalCountInFromPlc = table.Column<int>(type: "int", nullable: false),
                    TotalCountOutFromPlc = table.Column<int>(type: "int", nullable: false),
                    TotalCountFromPc = table.Column<int>(type: "int", nullable: false),
                    RecipeImportDir = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecipeImportFileName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ResultSummaryExportDir = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WorkingInfos", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BoxStates");

            migrationBuilder.DropTable(
                name: "CrystalLevelCounts");

            migrationBuilder.DropTable(
                name: "LevelCountsHistory");

            migrationBuilder.DropTable(
                name: "ModuleShields");

            migrationBuilder.DropTable(
                name: "SlaveParams");

            migrationBuilder.DropTable(
                name: "UserInfos");

            migrationBuilder.DropTable(
                name: "VisionOffsets");

            migrationBuilder.DropTable(
                name: "WaferSummaries");

            migrationBuilder.DropTable(
                name: "WorkingInfos");
        }
    }
}
